import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

export function getUserList(data) {
  return request({
    url: '/user/pageList',
    method: 'post',
    data
  })
}

export function addUser(data) {
  return request({
    url: '/user/create',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  console.info('delete id ' + data.id)
  return request({
    url: '/user/delete',
    method: 'post',
    data
  })
}

export function modifyUser(data) {
  return request({
    url: '/user/update',
    method: 'POST',
    data
  })
}